#!/usr/bin/env python

class Response ( object ):
	
	def __init__ ( self, start_response ):
		self._start_response = start_response
		self._headers = {}
		self._headers [ 'Content-Type' ] = 'text/plain'
		self._status = '200 OK'
		self._output = None
		
	def _start ( self ):
		self._start_response ( self._status, self._headers.items() )
		
	def __str__ ( self ):
		return self._output
		
	def __iter__ ( self ):
		yield self._output
		
	def set_header ( self, k, v ):
		self._headers [ k ] = v
		
	def set_output ( self, output ):
		self._output = output